package org.dromara.hm.enums;

/**
 * 回款调整状态枚举
 *
 * @Author Claude Code
 * @Date 2025-01-16
 * @Version 1.0
 */
public enum PaymentAdjustmentStatusEnum {
    PENDING("PENDING", "待审核"),
    APPROVED("APPROVED", "已批准"),
    REJECTED("REJECTED", "已驳回"),
    CANCELLED("CANCELLED", "已取消"),
    ;

    private final String code;
    private final String description;

    PaymentAdjustmentStatusEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据代码获取枚举
     *
     * @param code 代码
     * @return 枚举值
     */
    public static PaymentAdjustmentStatusEnum getByCode(String code) {
        for (PaymentAdjustmentStatusEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
